Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1132 Rename public members of IDE model #1173

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

annawendler
Copy link
Member

@annawendler annawendler commented Jan 7, 2025

Changes and Information

  • m_transitions was renamed to flows
  • m_populations was renamed to populations
  • m_total_confirmed_cases was renamed to total_confirmed_cases
  • Arguments of model constructor were partially renamed for better understanding

Merge Request - Guideline Checklist

Please check our git workflow. Use the draft feature if the Pull Request is not yet ready to review.

Checks by code author

  • Every addressed issue is linked (use the "Closes #ISSUE" keyword below)
  • New code adheres to coding guidelines
  • No large data files have been added (files should in sum not exceed 100 KB, avoid PDFs, Word docs, etc.)
  • Tests are added for new functionality and a local test run was successful (with and without OpenMP)
  • Appropriate documentation for new functionality has been added (Doxygen in the code and Markdown files if necessary)
  • Proper attention to licenses, especially no new third-party software with conflicting license has been added
  • (For ABM development) Checked benchmark results and ran and posted a local test above from before and after development to ensure performance is monitored.

Checks by code reviewer(s)

  • Corresponding issue(s) is/are linked and addressed
  • Code is clean of development artifacts (no deactivated or commented code lines, no debugging printouts, etc.)
  • Appropriate unit tests have been added, CI passes, code coverage and performance is acceptable (did not decrease)
  • No large data files added in the whole history of commits(files should in sum not exceed 100 KB, avoid PDFs, Word docs, etc.)
  • On merge, add 2-5 lines with the changes (main added features, changed items, or corrected bugs) to the merge-commit-message. This can be taken from the briefly-list-the-changes above (best case) or the separate commit messages (worst case).

Closes #1132

@annawendler annawendler linked an issue Jan 7, 2025 that may be closed by this pull request
Copy link

codecov bot commented Jan 7, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.97%. Comparing base (0c4965a) to head (9a321fc).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1173      +/-   ##
==========================================
- Coverage   96.97%   96.97%   -0.01%     
==========================================
  Files         148      148              
  Lines       13718    13714       -4     
==========================================
- Hits        13303    13299       -4     
  Misses        415      415              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@annawendler
Copy link
Member Author

I changed the name m_transitions to flows because it is in line with our simulation functions where we also use the term flow. The term transition (e.g. in transition_idx) still occurs in some places when we are referring to the transitions themselves and not to the number of individuals transitioning from one compartment to another.

Copy link
Member

@lenaploetzke lenaploetzke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work! Please consider especially to rename the InfectionTransisitons and the TransitionDistributions consistent to the flows TimeSeries.

m_transitions; ///< TimeSeries containing points of time and the corresponding number of transitions for every
// AgeGroup.
TimeSeries<ScalarType> m_populations; ///< TimeSeries containing points of time and the corresponding number of
flows; ///< TimeSeries containing points of time and the corresponding number of individuals transitioning from
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

flows and InfectionTransitions and Transitiondistributions are no longer linked by name. Do you think that's bad? I dont know how to feel about this.

@@ -84,7 +84,7 @@ int main(int argc, char** argv)
init.add_time_point(init.get_last_time() + dt,
Vec::Constant((int)mio::isecir::InfectionTransition::Count, 1. * dt));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Eventually adapt also the num_transitions in the ide examples and name them num_flows? Also in the tests? On the other hand this is consistent with InfectionTransition.. I dont know

* In the TimeSeries we store a vector for each time point. In this vector we store the different
* #InfectionTransition%s for every AgeGroup.
* In the TimeSeries we store a vector for each time point. In this vector we store values for the different
* InfectionTransitions for every AgeGroup.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not #InfectionTransition%s?

@@ -84,7 +84,7 @@ int main(int argc, char** argv)
init.add_time_point(init.get_last_time() + dt,
Vec::Constant((int)mio::isecir::InfectionTransition::Count, 1. * dt));
}
model.m_transitions = init;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you adjust in the example ide_secir lines 78+80+123+124 and in example ide_secir_ageres 64 - 69 + 124-125?

@@ -84,7 +84,7 @@ int main(int argc, char** argv)
init.add_time_point(init.get_last_time() + dt,
Vec::Constant((int)mio::isecir::InfectionTransition::Count, 1. * dt));
}
model.m_transitions = init;
model.flows = init;
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please also adapt the README (with m_populations). And maybe transitions to flows.

if (!((size_t)m_transitions.get_num_elements() == (size_t)InfectionTransition::Count * m_num_agegroups)) {
log_error("A variable given for model construction is not valid. Number of elements in transition vector "
if (!((size_t)flows.get_num_elements() == (size_t)InfectionTransition::Count * m_num_agegroups)) {
log_error("A variable given for model construction is not valid. Number of elements in vector of flows"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
log_error("A variable given for model construction is not valid. Number of elements in vector of flows"
log_error("A variable given for model construction is not valid. Number of elements in vector of flows."

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rename public members in IDE model
2 participants